package com.loongtech.bi.manager.game;

import com.loongtech.bi.entity.game.EntityRoleActivityJoinNum;
import com.loongtech.core.jpa.manager.ManagerQueryCacheBase;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;

@Service
public class RoleActivityJoinNumManager extends ManagerQueryCacheBase<EntityRoleActivityJoinNum> {
	private static final long serialVersionUID = 1L;

    public List<EntityRoleActivityJoinNum> getDatas(Date dayStart, Date dayEnd, String queryPlatform, String queryChannel, String queryServer, String activityType, List<String> activities) {
        return findByQuery("from EntityRoleActivityJoinNum where " +
                        "day>=:dayStart and day<=:dayEnd and platformid=:queryPlatform and channelid=:queryChannel and serverid=:queryServer and " +
                        "activitytype=:activityType and activityid in (:activityids) order by day, activityid ",
                "dayStart", dayStart, "dayEnd", dayEnd, "queryPlatform", queryPlatform, "queryChannel", queryChannel, "queryServer", queryServer, "activityType", activityType, "activityids", activities);
    }

    public List<EntityRoleActivityJoinNum> getDatasByVipLevel(Date dayStart, Date dayEnd,String queryPlatform, String queryChannel, String queryServer, String activityType, List<String> activities, List<Integer> viplevels) {
        return findByQuery("from EntityRoleActivityJoinNum where " +
                        "day>=:dayStart and day<=:dayEnd and platformid=:queryPlatform and channelid=:queryChannel and serverid=:queryServer and " +
                        "activitytype=:activityType and activityid in (:activityids) and viplevel in (:viplevels) order by day, activityid ",
                "dayStart", dayStart, "dayEnd", dayEnd, "queryPlatform", queryPlatform, "queryChannel", queryChannel, "queryServer", queryServer, "activityType", activityType, "activityids", activities, "viplevels", viplevels);
    }
}
